package com.example.epic.service.impl;

import com.example.epic.bean.Student;
import com.example.epic.bean.WeChatUser;
import com.example.epic.dao.StudentDao;
import com.example.epic.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentDao studentDao;


    @Override
    public Student findStudentByOpenid(String openId) {
        return studentDao.findStudentByOpenid(openId);
    }

    @Override
    public Student findStudentByStudentId(String studentId) {
        return studentDao.findStudentByStudentId(studentId);
    }

    @Override
    public void updateStudent(Student student) {
        studentDao.updateStudent(student);
    }

    @Override
    public void saveStudent(Student student) {
        studentDao.updateStudent(student);
    }

    @Override
    public void deleteStudent(Integer id) {
        studentDao.deleteStudent(id);
    }

    @Override
    public void bindWeChat(WeChatUser weChatUser) {
        studentDao.bindWeChat(weChatUser);
    }
}
